import request from '@/utils/request'

// 查询定位日志列表
export function listLocationLog(query) {
  return request({
    url: '/pack/location/log/list',
    method: 'get',
    params: query
  })
}

// 高级搜索定位日志
export function searchLocationLog(params) {
  return request({
    url: '/pack/location/log/search',
    method: 'get',
    params
  })
}

// 查询定位日志详细
export function getLocationLog(logId) {
  return request({
    url: '/pack/location/log/' + logId,
    method: 'get'
  })
}

// 新增定位日志
export function addLocationLog(data) {
  return request({
    url: '/pack/location/log',
    method: 'post',
    data: data
  })
}

// 修改定位日志
export function updateLocationLog(data) {
  return request({
    url: '/pack/location/log',
    method: 'put',
    data: data
  })
}

// 删除定位日志
export function delLocationLog(logId) {
  return request({
    url: '/pack/location/log/' + logId,
    method: 'delete'
  })
}

// 导出定位日志
export function exportLocationLog(query) {
  return request({
    url: '/pack/location/log/export',
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}

// 查询定位器最新位置
export function getLatestLocation(locatorId) {
  return request({
    url: '/pack/location/log/latest/' + locatorId,
    method: 'get'
  })
}

// 查询器具最新位置
export function getLatestContainerLocation(containerId) {
  return request({
    url: '/pack/location/log/container/latest/' + containerId,
    method: 'get'
  })
} 